package com.zzc.another;

import java.io.*;

/**
 * Created by Administrator on 2017/4/13 0013.
 */
public class UploadFile {
    private static int fileSize=1024*1024*20;//20M
    public static void UploadFile(File upFile,String upFileName,String path) throws IOException {
        InputStream in=new FileInputStream(upFile);
        File toFile = new File(path,upFileName);
        OutputStream out=new FileOutputStream(toFile);
        byte[] buffer = new byte[fileSize];
        int length=0;
        while ((length = in.read(buffer)) > 0) {
            out.write(buffer, 0, length);
        }
        in.close();
        out.close();
    }
}
